package org.example

import org.example.common.DButils

class UserOper {
  case class User(id: Int, username: String, password: String, isvlid: Int)

  def Select(): Unit = {
    val con = DButils.getConn()
    val sql = "select * from sysuser"
    try {
      val ps = con.prepareStatement(sql.toString())
      val t = ps.executeQuery()
      while (t.next()) {
        println("登录名姓名：" + t.getString("username"))
      }
      println(t)
    }catch{
      case ex:Exception => {println("读取数据报错")}

    }finally{
      DButils.closeCon(con)
    }
  }}